package w11;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ValNo {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入学号:");
		String no = in.next();
		
		Pattern p = Pattern.compile("^(2\\d{3})\\d{8}$");
		Matcher m = p.matcher(no);
		if (m.matches()) {
			String y = m.group(1);
			System.out.println("年级:" + y);
		} else {
			System.out.println("不合法的学号");
		}
		
	}

}
